1. Field of the Invention
This invention relates to the manufacture of microcontrollers and more particularly to the manufacture of microcontrollers which can exchange data with external devices.
2. Description of the Relevant Art
A microcontroller is an integrated circuit which incorporates a microprocessor core along with one or more support circuits on the same monolithic semiconductor substrate (i.e., chip). A typical computer system includes a microprocessor secured within its own semiconductor device package and connected to several separately-packaged support circuits. The support circuits perform support functions such as communication functions and memory interface functions. Computer systems which employ microcontrollers may thus be formed using fewer semiconductor devices. Advantages of such systems include lower fabrication costs and higher reliabilities. Microcontrollers find applications in industrial and commercial products including control systems, computer terminals, hand-held communications devices (e.g., cellular telephones), photocopier machines, facsimile machines, and hard disk drives.
Asynchronous serial communication is the standard means of transmitting data over distances greater than about 25 feet. In serial data communication, each unit of data (e.g., an 8-bit byte representing a character) is transmitted one bit at a time over a transmission medium (e.g., a pair of wires, a coaxial cable, etc.). In asynchronous serial communication, a "start" bit (always a 0) is typically transmitted before the first character bit, and one or more "stop" bits (always a 1) are transmitted after the last character bit. These extra bits are used to "frame" the data in order to signal the beginning and end of a character bit transmission, thus synchronizing a transmitter and a receiver. The transmitter and receiver must both use the same set of rules designating how many bits are transmitted per second (i.e., the baud rate), how many bits represent a character, whether a parity bit is transmitted after the last character bit, and how many stop bits are added after character transmission.
Due to the prevalence of serial data communication, many microcontrollers include one or more asynchronous serial ports (ASPs) which can transmit and/or receive data one bit at a time. Such microcontrollers typically employ interrupt signals to notify the microprocessor core that an ASP requires service. An ASP typically issues an interrupt request signal when a character has been received by the ASP and needs to be transferred from the ASP to an external memory unit, or when the ASP has finished transmitting a character and the next character to be transmitted must be transferred from the external memory unit to the ASP.
The microprocessor core executes instructions of software programs. Upon receiving an interrupt request signal from the ASP, the microprocessor core stops program execution, saves the contents of certain critical registers (i.e., saves its internal state), and begins executing instructions of an appropriate interrupt service routine (i.e., an interrupt handler) associated with the ASP. When execution of the interrupt service routine is completed, the microprocessor core restores the saved contents of the critical registers (i.e., restores the internal state) and resumes execution of the interrupted program at the point where the interruption occurred.
When interrupts are used to service an ASP, the microprocessor core must first save its internal state and execute a portion of the instructions of the interrupt service routine. The amount of time required to perform these actions places an upper bound on the number of bits the ASP may transmit or receive each second (i.e., the maximum operational baud rate of the ASP). In addition, the microprocessor core must interrupt program execution in order to service the ASP, negatively impacting the performance of the microprocessor core.
Direct memory access (DMA) is a well known technique which allows data transfers without involving the microprocessor core. In addition, many microcontrollers include a DMA unit which controls DMA data transfer operations. The microprocessor core simply initializes control registers within the DMA unit with transfer control information. The transfer control information typically includes the first address of the source of the block of data to be transferred (i.e., the source address), the first address of the destination of the block of data to be transferred (i.e., the destination address), and the number of bytes or words to be transferred (i.e., the byte/word count).
When a device needs to transfer data, the device generates a DMA request signal. The DMA unit responds to the DMA request signal by gaining control of the common bus interconnecting the involved devices and initiating the data transfer operation. The DMA unit generates address and control signals needed to read a byte or word of data from the source address and to write the data to the destination address. After each read/write operation, the source and destination addresses and the byte/word count are either incremented or decrement. This process is continued until the data transfer operation is complete. When the data transfer operation is complete, the DMA unit relinquishes control of the common bus.
It would thus be desirable to have a microcontroller which is configurable to transfer data to and from one or more ASPs using DMA. The maximum baud rate of each ASP within the microcontroller would be increased, and the performance of the microprocessor core of the microcontroller would be improved during ASP operation. It would also be advantageous to route a DMA request signal from an ASP to the DMA unit internal to the microcontroller.